<template>
<view>
<image class="banner" mode="scaleToFill" :src="saleinfo['sale_logo']"></image>
<view @tap="saletap" class="sell_btn" v-if="saleinfo['upload']==1">立即卖车</view>
<view @tap="block_click" class="zixun_btn">免费咨询</view>
<view @tap="gujia" class="zixun_gujia">爱车估价</view>
<view class="guanggao_view" v-if="unitid!=123">
    <ad :unitId="unitid"></ad>
</view>
<view style="bottom:10px;position:absolute; width:100%;">
    
<!--[miniprogram-to-uniapp] 公众号关注组件 仅微信小程序支持-->
<!-- #ifdef MP-WEIXIN -->
<official-account></official-account>
<!-- #endif -->

<!-- #ifndef MP-WEIXIN -->
<view>当前为非微信小程序环境，不支持公众号关注组件，请自行调整当前弹窗内容！</view>
<!-- #endif -->


</view>
</view>
</template>

<script>
var app = getApp();

export default {
  data() {
    return {
      block: 0,
      saleinfo: [],
      unitid: 123
    };
  },

  components: {},
  props: {},
  onLoad: function (a) {
    var n = this;
    console.log(123), app.globalData.util.request({
      url: "entry/wxapp/Api",
      data: {
        m: "monai_market",
        r: "sale.index.salenew"
      },
      cachetime: "0",
      success: function (a) {
        console.log(a), n.setData({
          saleinfo: a.data.data
        }), 2 == a.data.data.sell_flow && "" != a.data.data.flow_id && n.setData({
          unitid: a.data.data.flow_id
        }), wx.setNavigationBarTitle({
          title: a.data.data.name
        });
      }
    });
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {},
  methods: {
    saletap: function () {
      wx.navigateTo({
        url: "../sale/index"
      });
    },
    gujia: function () {
      wx.navigateTo({
        url: "/pagesA/gujia/index"
      });
    },
    none_click: function () {
      this.setData({
        block: 0
      });
    },
    block_click: function () {
      wx.makePhoneCall({
        phoneNumber: this.saleinfo.phone
      });
    }
  }
};
</script>
<style>
@import "./index.css";
</style>